
cbuffer cbPerObject : register(b0)
{
	float4x4 gWorld;
	float4x4 gView;
	float4x4 gProj;
};

struct VertexInGraphics
{
	float3 PosL		: POSITION;
	float3 NormalL	: NORMAL;
	float4 Color0	: COLOR0;
	float4 Color1	: COLOR1;
};

struct VertexOut
{
	float4 PosH  : SV_POSITION;
    float4 Color : COLOR;
};

VertexOut ColorVS(VertexInGraphics vinG)
{
	VertexOut vout;
	
	// Transform to homogeneous clip space.
	vout.PosH = mul(float4(vinG.PosL, 1.0f), gWorld);
	vout.PosH = mul(vout.PosH, gView);
	vout.PosH = mul(vout.PosH, gProj);
	
	// Just pass vertex color into the pixel shader.
    vout.Color = vinG.Color0;
    
    return vout;
}

float4 ColorPS(VertexOut pin) : SV_Target
{
    return pin.Color;
}